<script>
export default {
  data() {
    return {
      doctorInfo: {}
    }
  },
  methods: {
    sendMessage() {
      // 发送消息的逻辑
    },
    editDoctor() {
      // 编辑医生信息的逻辑
    },
    deleteDoctor() {
      // 删除医生的逻辑
    },
    goBack() {
      // 返回的逻辑
      this.$router.push('/doctor')
    }
  },
  created() {
    // 从路由参数中获取医生信息
    this.doctorInfo = JSON.parse(localStorage.getItem("doctor"))
  }
}
</script>



<template>
  <div style="width: 100%;margin-left: 20px;margin-right: 40px" align="center;">
    <div style="background-color: #F2F7FB;padding: 10px 0px 0px 0px" >
      <el-header align="left" style="margin-top: 60px;"> |  医生详情</el-header>
      <el-main align="left">
        <div style=" display: flex;justify-content: space-between;padding: 0px 40px">
          <div> 医生编号：{{ doctorInfo.id }}</div>
          医生姓名：{{ doctorInfo.name }}
          <img style="width: 50px;border-radius: 100%" v-if="doctorInfo.img" :src="doctorInfo.img" alt="医生头像">
          联系电话：{{ doctorInfo.phone }}
        </div>
        <div style="margin-left: 40px">
          <p style="margin-top: 20px">性别：{{ doctorInfo.sex }}</p>
          <p style="margin-top: 20px">医生简介：{{ doctorInfo.introduce }}</p>
          <p style="margin-top: 20px">医生擅长：{{ doctorInfo.speciality }}</p>
          <p style="margin-top: 20px">加入团队：{{ doctorInfo.tid }}</p>
<!--          <p style="margin-top: 20px">签约人数：{{ doctorInfo.contractCount }}</p>-->
<!--          <p style="margin-top: 20px">医生评分：{{ doctorInfo.rating }} ({{ doctorInfo.ratingCount }}人评价)</p>-->
          <p style="margin-top: 20px">创建时间：{{ doctorInfo.creation }}</p>
<!--          <p style="margin-top: 20px">创建人：{{ doctorInfo.creator }}</p>-->
<!--          <p style="margin-top: 20px">账号状态：{{ doctorInfo.status }}</p>-->
          <div style="margin-top: 20px">
            状态：<el-switch
              disabled
                v-model="doctorInfo.status"
                active-color="#13ce66"
                inactive-color=""
                :active-value="1"
                :inactive-value="0"
            ></el-switch>
<!--            <span v-if="doctorInfo.status" class="switch-text">启用</span>-->
<!--            <span v-else class="switch-text2">禁用</span>-->
          </div>
        </div>

        <div style="margin-left: 40px;margin-top: 30px">
          <el-button style="width: 100px" type="primary" @click="sendMessage">发送消息</el-button>
<!--          <el-button style="width: 140px" type="primary" @click="editDoctor">编辑医生信息</el-button>-->
<!--          <el-button style="width: 100px" type="danger" @click="deleteDoctor">删除</el-button>-->
          <el-button style="width: 100px" type="default" @click="goBack">返回</el-button>
        </div>
      </el-main>
    </div>
  </div>
</template>

<style>
.switch-text {
  position: absolute;
  left: 58px;
  top: 53%;
  transform: translateY(-50%);
  color: white;
  font-size: 9px;
}

.switch-text2 {
  position: absolute;
  left: 73px;
  top: 52%;
  transform: translateY(-50%);
  color: black;
  font-size: 9px;
}
</style>

